<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>StartFingerprint</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">StartFingerprint()</font></b></p>
<p><b>语法</b></p><blockquote>

Result = <font color="#3A3966"><b>StartFingerprint</b></font>(#Fingerprint, Plugin [, Bits])</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Initializes the calculation of a fingerprint in several steps. Unlike 
<a href="fingerprint.html">Fingerprint()</a> function this allows to calculate the fingerprint of 
large data without the need to load it all into one continuous memory buffer. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Fingerprint</i></td>
<td width="90%"> 
The number to refer to this checksum calculation in later calls. <a href="../reference/purebasic_objects.html">#PB_Any</a> 可以用来自动生成这个编码. 

</td></tr>
<tr><td><i>Plugin</i></td>
<td> 
The plugin to use. 它可以是以下值之一︰ 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Cipher_CRC32</font>: uses CRC32 algorithm. <a href="usecrc32fingerprint.html">UseCRC32Fingerprint()</a> needs to be called before to register this plugin.
  <font color="#924B72">#PB_Cipher_MD5</font>  : uses MD5 algorithm. <a href="usemd5fingerprint.html">UseMD5Fingerprint()</a> needs to be called before to register this plugin.
  <font color="#924B72">#PB_Cipher_SHA1</font> : uses SHA1 algorithm. <a href="usesha1fingerprint.html">UseSHA1Fingerprint()</a> needs to be called before to register this plugin.
  <font color="#924B72">#PB_Cipher_SHA2</font> : uses SHA2 algorithm. <a href="usesha2fingerprint.html">UseSHA2Fingerprint()</a> needs to be called before to register this plugin.
  <font color="#924B72">#PB_Cipher_SHA3</font> : uses SHA3 algorithm. <a href="usesha3fingerprint.html">UseSHA3Fingerprint()</a> needs to be called before to register this plugin.
</font></pre>

</td></tr>
<tr><td><i>Bits (optional)</i></td>
<td> 
 
The bits number to use for the fingerprint. It is only supported for the following plugin: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Cipher_SHA2</font> : can be 224, 256 (default), 384 or 512.
  <font color="#924B72">#PB_Cipher_SHA3</font> : can be 224, 256 (default), 384 or 512.
</font></pre>

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns the #Fingerprint value if <font color="#924B72">#PB_Any</font> was used for that parameter. 

 

</blockquote><p><b>备注</b></p><blockquote>

<a href="addfingerprintbuffer.html">AddFingerprintBuffer()</a> can be used to add memory blocks into the calculation 
and <a href="finishfingerprint.html">FinishFingerprint()</a> to finish the calculation and read the resulting hash. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2"><font color="#3A3966">  UseMD5Fingerprint</font>()

  *Buffer =<font color="#3A3966"> AllocateMemory</font>(200) <font color="#3A3966">; Prepare a buffer with data</font>
  <b><font color="#3A3966">If</font></b> *Buffer
<font color="#3A3966">    PokeS</font>(*Buffer, "The quick brown fox jumps over the lazy dog.", -1, <font color="#924B72">#PB_Ascii</font>)
    Length =<font color="#3A3966"> MemoryStringLength</font>(*Buffer, <font color="#924B72">#PB_Ascii</font>)
    
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">StartFingerprint</font>(0, <font color="#924B72">#PB_Cipher_MD5</font>)          <font color="#3A3966">; start the calculation</font>
<font color="#3A3966">      AddFingerprintBuffer</font>(0, *Buffer, Length/2)          <font color="#3A3966">; calculate part 1</font>
<font color="#3A3966">      AddFingerprintBuffer</font>(0, *Buffer+Length/2, Length/2) <font color="#3A3966">; calculate part 2</font>
      
      MD5$ =<font color="#3A3966"> FinishFingerprint</font>(0)                  <font color="#3A3966">; finish calculation</font>
      <b><font color="#3A3966">Debug</font></b> "MD5 checksum = " + MD5$
      
      MD5$ =<font color="#3A3966"> Fingerprint</font>(*Buffer, Length, <font color="#924B72">#PB_Cipher_MD5</font>)  <font color="#3A3966">; compare to a calculation in 1 step</font>
      <b><font color="#3A3966">Debug</font></b> "MD5 checksum = " + MD5$
    <b><font color="#3A3966">EndIf</font></b>

<font color="#3A3966">    FreeMemory</font>(*Buffer)
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="fingerprint.html">Fingerprint()</a>, <a href="filefingerprint.html">FileFingerprint()</a>, <a href="stringfingerprint.html">StringFingerprint()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=startaescipher.html>StartAESCipher()</a> - <a href="index.html">Cipher Index</a> - <a href="stringfingerprint.html">StringFingerprint()</a> -&gt;<br><br>

</body></html>